<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>layout 后台大布局 - Layui</title>
  <link rel="stylesheet" href="statics/plugins/layui-2.2.5/layui/css/layui.css">
  <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo">MyApp</div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a href="">控制台</a></li>
      <li class="layui-nav-item"><a href="">商品管理</a></li>
      <li class="layui-nav-item"><a href="">用户</a></li>
      <li class="layui-nav-item">
        <a href="javascript:;">其它系统</a>
        <dl class="layui-nav-child">
          <dd><a href="">邮件管理</a></dd>
          <dd><a href="">消息管理</a></dd>
          <dd><a href="">授权管理</a></dd>
        </dl>
      </li>
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="img/1.png" class="layui-nav-img">
        ${info.name}
        </a>
        <dl class="layui-nav-child">
          <dd><a href="">基本资料</a></dd>
          <dd><a href="">安全设置</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="user/logout">退出</a></li>
    </ul>
  </div>
  
  <div  class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="javascript:;">所有商品</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;" v-on:click="fenYe">分页</a></dd>
            <dd><a href="javascript:;">列表二</a></dd>
            <dd><a href="javascript:;">列表三</a></dd>
            <dd><a href="">超链接</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;">解决方案</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">列表一</a></dd>
            <dd><a href="javascript:;">列表二</a></dd>
            <dd><a href="">超链接</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item"><a href="">云市场</a></li>
        <li class="layui-nav-item"><a href="">发布商品</a></li>
      </ul>
    </div>
  </div>
  
  <div id="ells" class="layui-body">
    <!-- 内容主体区域 -->
    <div style="padding: 15px;">内容主体区域

      <button @click="clikMe">点我</button>

    </div>
    
 <table class="layui-hide" id="demo"></table>
    
    
  </div>
  
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
  </div>
</div>
<script src="statics/plugins/layui-2.2.5/layui/layui.js" charset="utf-8"></script>
<script src="js/jquery-2.1.1.js"></script>
<script src="js/vue.min.js"></script>
<script>
//JavaScript代码区域
var edata;
var vm = new Vue({
    el:'#ells',
    data:{
    },methods: {
        clikMe: function () {
            $.ajax({
                type: "GET",
                url: "user/query",
                dataType: "json",
                success: function(result){
                    if(result.code == 0){
                        //登录成功
                        edata=eval(result.data.userList)

                        console.log(edata)

                        alert(JSON.stringify(edata))

                          layui.use('table', function(){
                            var table = layui.table;
                            //展示已知数据
                            table.render({
                              elem: '#demo'
                              ,height: 332
                              //        ,url:'user/query'
                              ,page: true //开启分页
                              ,cols: [[ //标题栏
                                {field: 'id', title: 'ID', width: 80, sort: true}
                                ,{field: 'name', title: '用户名', width: 120}
                                ,{field: 'password', title: '邮箱', minWidth: 150}
                                ,{field: 'createTime', title: '签名', minWidth: 160}
                                ,{field: 'roleId', title: '性别', width: 80}
                                ,{field: 'salt', title: '城市', width: 100}
                              ]]

                            });
                          });

                    }else{
                      alert('fail')
                    }
                }
            });
        }
    }
});
  layui.use('element', function(){
    var element = layui.element;
  });



   



</script>
</body>
</html>